@(projects: List[models.domain.Project], afangar: List[models.general.vNemandiAfangarOnn], announcements: List[models.domain.Announcements],comments: List[models.domain.Comments],
monday: List[models.domain.TimetableHomework],tuesday: List[models.domain.TimetableHomework],wednesday: List[models.domain.TimetableHomework],thursday: List[models.domain.TimetableHomework],
friday: List[models.domain.TimetableHomework], nafn: String)
@main(title = "Forsíða") {
    <link rel="stylesheet" href="/public/stylesheets/StudentDashboard.css" xmlns="http://www.w3.org/1999/html">
    <script src="/public/javascripts/dashboard.js"></script>

    <div class="container dashCon">
        <div class="row paddingRow">
            <div class ="span6">
                <div class ="tabbable">
                    <ul class="nav nav-tabs">
                        <li class ="active dashStaerri"><a href ="#tab1" data-toggle="tab">Mánud </a> </li>
                        <li><a href ="#tab2" class = "dashStaerri" data-toggle="tab">Þriðjud </a> </li>
                        <li><a href ="#tab3" class = "dashStaerri" data-toggle="tab">Miðvikud </a> </li>
                        <li><a href ="#tab4" class = "dashStaerri" data-toggle="tab">Fimmtud </a> </li>
                        <li><a href ="#tab5" class = "dashStaerri" data-toggle="tab">Föstud </a> </li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">
                            <ul class="timetable">
                                @for(record <- monday) {
                                        <ul class="timetable_row stundTop">
                                        <a title="Sjá heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                            <div class="row-fluid">
                                                <div class="span4">
                                                    @if(record.getTimeslot== 1){
                                                        <li>8:30 - 9:15</li>}
                                                    @if(record.getTimeslot== 2){
                                                        <li>9:20 - 10:05</li>}
                                                    @if(record.getTimeslot== 3){
                                                        <li>10:20-11:05</li>}
                                                    @if(record.getTimeslot== 4){
                                                        <li>11:10-11:55</li>}
                                                    @if(record.getTimeslot== 5){
                                                        <li>12:20-13:05</li>}
                                                    @if(record.getTimeslot== 6){
                                                        <li>13:10-13:55</li>}
                                                    @if(record.getTimeslot== 7){
                                                        <li>14:00-14:45</li>}
                                                    @if(record.getTimeslot== 8){
                                                        <li>14:55-15:40</li>}
                                                </div>
                                                <div class="span3">
                                                    @if(record.getNamsgrein_afanganr!=""){
                                                        <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                                    }else{
                                                        <li></li>
                                                    }
                                                </div>
                                                <div class="span3">
                                                    @if(record.getNamsgrein_afanganr!= ""){
                                                        <li>Stofa: @record.getStofa</li>
                                                    }else{
                                                        <li></li>
                                                    }
                                                </div>

                                        </a>
                                            <br/><br/>
                                        <div id='@record.getId' class="day1" style="display: none;">Heimavinna fyrir þennan tíma: @record.getHeimavinnaTexti</div>
                                        </ul>
                                }

                            </ul>
                            <a href="#" onclick="ShowAll('day1',1)" id="show1" class="heimavinna"> Sjá alla heimavinnu</a>
                            <a href="#" onclick="hideAll('day1',1)" id="hide1" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                        </div>
                        <div class="tab-pane" id="tab2">
                            <ul class="timetable">
                                @for(record <- tuesday) {
                                    <ul class="timetable_row stundTop">
                                    <a title="Sjá heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                    <div class="row-fluid">
                                    <div class="span4">
                                        @if(record.getTimeslot== 1){
                                            <li>8:30 - 9:15</li>}
                                        @if(record.getTimeslot== 2){
                                            <li>9:20 - 10:05</li>}
                                        @if(record.getTimeslot== 3){
                                            <li>10:20-11:05</li>}
                                        @if(record.getTimeslot== 4){
                                            <li>11:10-11:55</li>}
                                        @if(record.getTimeslot== 5){
                                            <li>12:20-13:05</li>}
                                        @if(record.getTimeslot== 6){
                                            <li>13:10-13:55</li>}
                                        @if(record.getTimeslot== 7){
                                            <li>14:00-14:45</li>}
                                        @if(record.getTimeslot== 8){
                                            <li>14:55-15:40</li>}
                                    </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr!=""){
                                            <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                        <div class="span3">
                                            @if(record.getNamsgrein_afanganr != ""){
                                                <li>Stofa: @record.getStofa</li>
                                            }else{
                                                <li></li>
                                            }
                                        </div>
                                        </a>
                                        <br/><br/>
                                        <div id='@record.getId' class ="day2" style="display: none;">Heimavinna fyrir þennan tíma: @record.getHeimavinnaTexti</div>
                                    </ul>
                                }

                            </ul>
                            <a href="#" onclick="ShowAll('day2',2)" id="show2" class="heimavinna"> Sjá alla heimavinnu</a>
                            <a href="#" onclick="hideAll('day2',2)" id="hide2" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                        </div>
                        <div class="tab-pane" id="tab3">
                            <ul class="timetable">
                                @for(record <- wednesday) {
                                    <ul class="timetable_row stundTop">
                                    <a title="Sjá heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                    <div class="row-fluid">
                                    <div class="span4">
                                        @if(record.getTimeslot== 1){
                                            <li>8:30 - 9:15</li>}
                                        @if(record.getTimeslot== 2){
                                            <li>9:20 - 10:05</li>}
                                        @if(record.getTimeslot== 3){
                                            <li>10:20-11:05</li>}
                                        @if(record.getTimeslot== 4){
                                            <li>11:10-11:55</li>}
                                        @if(record.getTimeslot== 5){
                                            <li>12:20-13:05</li>}
                                        @if(record.getTimeslot== 6){
                                            <li>13:10-13:55</li>}
                                        @if(record.getTimeslot== 7){
                                            <li>14:00-14:45</li>}
                                        @if(record.getTimeslot== 8){
                                            <li>14:55-15:40</li>}
                                    </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr!=""){
                                            <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                        <div class="span3">
                                            @if(record.getNamsgrein_afanganr != ""){
                                                <li>Stofa: @record.getStofa</li>
                                            }else{
                                                <li></li>
                                            }
                                        </div>
                                    </a>
                                    <br/><br/>
                                    <div id='@record.getId' class ="day3" style="display: none;">Heimavinna fyrir þennan tíma: @record.getHeimavinnaTexti</div>
                                    </ul>
                                }

                            </ul>
                            <a href="#" onclick="ShowAll('day3',3)" id="show3" class="heimavinna"> Sjá alla heimavinnu</a>
                            <a href="#" onclick="hideAll('day3',3)" id="hide3" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                        </div>
                        <div class="tab-pane" id="tab4">
                            <ul class="timetable">
                                @for(record <- thursday) {
                                    <ul class="timetable_row stundTop">
                                    <a title="Sjá heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                    <div class="row-fluid">
                                    <div class="span4">
                                        @if(record.getTimeslot== 1){
                                            <li>8:30 - 9:15</li>}
                                        @if(record.getTimeslot== 2){
                                            <li>9:20 - 10:05</li>}
                                        @if(record.getTimeslot== 3){
                                            <li>10:20-11:05</li>}
                                        @if(record.getTimeslot== 4){
                                            <li>11:10-11:55</li>}
                                        @if(record.getTimeslot== 5){
                                            <li>12:20-13:05</li>}
                                        @if(record.getTimeslot== 6){
                                            <li>13:10-13:55</li>}
                                        @if(record.getTimeslot== 7){
                                            <li>14:00-14:45</li>}
                                        @if(record.getTimeslot== 8){
                                            <li>14:55-15:40</li>}
                                    </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr!=""){
                                            <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                        <div class="span3">
                                            @if(record.getNamsgrein_afanganr != ""){
                                                <li>Stofa: @record.getStofa</li>
                                            }else{
                                                <li></li>
                                            }
                                        </div>
                                    </a>
                                    <br/><br/>
                                    <div id='@record.getId' class ="day4" style="display: none;">Heimavinna fyrir þennan tíma: @record.getHeimavinnaTexti</div>
                                    </ul>
                                }

                            </ul>
                            <a href="#" onclick="ShowAll('day4',4)" id="show4" class="heimavinna"> Sjá alla heimavinnu</a>
                            <a href="#" onclick="hideAll('day4',4)" id="hide4" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                        </div>
                        <div class="tab-pane" id="tab5">
                            <ul class="timetable">
                                @for(record <- friday) {
                                    <ul class="timetable_row stundTop">
                                    <a title="Sjá heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                    <div class="row-fluid">
                                    <div class="span4">
                                        @if(record.getTimeslot== 1){
                                            <li>8:30 - 9:15</li>}
                                        @if(record.getTimeslot== 2){
                                            <li>9:20 - 10:05</li>}
                                        @if(record.getTimeslot== 3){
                                            <li>10:20-11:05</li>}
                                        @if(record.getTimeslot== 4){
                                            <li>11:10-11:55</li>}
                                        @if(record.getTimeslot== 5){
                                            <li>12:20-13:05</li>}
                                        @if(record.getTimeslot== 6){
                                            <li>13:10-13:55</li>}
                                        @if(record.getTimeslot== 7){
                                            <li>14:00-14:45</li>}
                                        @if(record.getTimeslot== 8){
                                            <li>14:55-15:40</li>}
                                    </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr!=""){
                                            <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                        <div class="span3">
                                            @if(record.getNamsgrein_afanganr != ""){
                                                <li>Stofa: @record.getStofa</li>
                                            }else{
                                                <li></li>
                                            }
                                        </div>
                                    </a>
                                    <br/><br/>
                                    <div id='@record.getId' class ="day5" style="display: none;">Heimavinna fyrir þennan tíma: @record.getHeimavinnaTexti</div>
                                    </ul>
                                }

                            </ul>
                            <a href="#" onclick="ShowAll('day5',5)" id="show5" class="heimavinna"> Sjá alla heimavinnu</a>
                            <a href="#" onclick="hideAll('day5',5)" id="hide5" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                        </div>
                    </div>
                </div>
            </div>

            <div class="span6">
                <div class ="tabbable">
                    <ul class="nav nav-tabs">
                        <li ><a href="allStudentAnnouncements" class = "dashStaerri">Tilkynningar</a> </li>

                    </ul>
                </div>
                <table class = "table">
                    @for(announcement <- announcements){
                        <div class="wellAnnouncementsDashboard">
                            <p class="underScore11pt">@announcement.dagur_stofnad &nbsp;&nbsp;@announcement.namsgrein_afanganr</p>
                            <p class="bold12pt">@announcement.fyrirsogn</p>
                            <p class="reg11pt">@announcement.texti</p>
                        </div>
                    }
                </table>

            </div>
        </div>

        <div class="span12">
        <div class="row paddingRow">
            <div class="span6">
                <div class ="tabbable">
                    <ul class="nav nav-tabs">
                        <li><a href ="studentOpenAssignments" class = "dashStaerri" title="Sjá næstu skil">Næstu Skil</a> </li>
                    </ul>
                </div>
                <table style="white-space: normal;" class = "table table-striped tableNoOverflow">
                    <tr>
                        <th>Áfangi</th>
                        <th class="span2">Heiti</th>
                        <th>Tegund</th>
                        <th>Staða</th>
                        <th>Skiladagur</th>
                    </tr>
                    @for(project <- projects){
                        @if(project.getHandedIn == true){
                            <tr class="success">
                                <td>@{project.getCourse}</td>
                                <td ><a href="studentOneProject/@project.getVerkefni_id" style="color:black;"/>@{project.getName}</td>
                                @if(project.getType=="test"){
                                    <td >Próf</td>
                                }
                                @if(project.getType=="project"){
                                    <td>Verkefni</td>
                                }
                                @if(project.getHandedIn==true){
                                    <td>Skilað</td>
                                }
                                @if(project.getHandedIn==false){
                                    <td>Óskilað</td>
                                }
                                <td id="d@project.getVerkefni_id()">@{project.getHandInDate}</td>

                            </tr>
                        }else{
                            <tr id="d@project.getVerkefni_id()">
                                <td>@{project.getCourse}</td>
                                <td><a href="studentOneProject/@project.getVerkefni_id" style="color:black;"/>@{project.getName}</td>
                                @if(project.getType=="test"){
                                    <td>Próf</td>
                                }
                                @if(project.getType=="project"){
                                    <td>Verkefni</td>
                                }
                                @if(project.getHandedIn==true){
                                    <td>Skilað</td>
                                }
                                @if(project.getHandedIn==false){
                                    <td>Óskilað</td>
                                }
                                <td >@{project.getHandInDate}</td>

                            </tr>
                        }

                    }
                </table>
            </div>

            <div class="span6">
                <div class ="tabbable">
                    <ul class="nav nav-tabs">
                        <li><a href ="courses/0" class = "dashStaerri" title="Sjá alla áfanga">Áfangar</a> </li>
                    </ul>
                </div>
                <table class = "table table-striped">
                    <tr>
                        <th>Áfangi</th>
                        <th>Hópur</th>
                    </tr>
                    @for(afangi <- afangar){
                        <tr>
                        <td> <a href="courses/@{afangi.getAfangi_id}" />@{afangi.namsgrein_afanganr}</td>
                        <td>@{afangi.hopur}</td>
                        </tr>
                    }
                </table>
            </div>
        </div>
        </div>

            <script>
                    $(document).ready(function(){
                    $(".commentInfo").hide();
                    //$(".show_hide").show();
                    $('.show_hide').click(function(){
                    $(".commentInfo").slideToggle();
                    });
                    });
            </script>


            <div class="row paddingRow">
                <div class="span12">
                    <div class ="tabbable">
                        <ul class="nav nav-tabs">
                            <li><a href="allStudentDiscussions" title="Sjá allar umræður" class = "dashStaerri">Nýjustu umræður</a> </li>
                        </ul>
                    </div>
                    <ul class="discussions">
                        @for(comment <- comments){
                                <li><a href="studentOneProject/@comment.getVerkefni_id" style="color:black;"/>@{comment.stofnad_stengur} &nbsp;&nbsp;&nbsp;&nbsp;@{comment.getName} kom með athugasemd við verkefnið @{comment.getVerkefni_nafn} sem þú hefur komið með athugasemd við
                        }
                    </ul>
                </div>


            </div>

            <script language="javascript" type="text/javascript">
                @for(project <- projects){
                        var tumi = "@{project.getHandInDate}";
                        var datearray = tumi.split(".");
                        var yeararray = datearray[2].split(" ");
                        var timinn = yeararray[0] + '/' + datearray[1] + '/' + datearray[0] + ' ' + yeararray[1];

                        var date = new Date(timinn);
                        var description = "Skiladagur";
                        var now = new Date();
                        var diff = date.getTime() - now.getTime();
                        var days = Math.floor(diff / (1000 * 60 * 60 * 24));
                        var element = document.getElementById("d@project.getVerkefni_id()");

                        if (days < 2) {
                        element.className='error';
                        }
                        if(days == 2 || days == 3){
                        element.className='warning';
                        }
                }
            </script>
    </div>
}